package hash

import (
	"gddgame.cc/galaxy/utils/hash"
)

type Strategy struct {
	*hash.Consistent
}

func NewStrategy() *Strategy {
	s := &Strategy{
		hash.NewConsistent(),
	}
	return s
}

func (strategy *Strategy) SetNodes(nodes []string) {
	strategy.Set(nodes)
}

func (strategy *Strategy) Alloc(key string) string {
	n, _ := strategy.Get(key)
	return n
}
